﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TienTeTuong
{
    public partial class AjaxFeedback : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string name = Request.QueryString["name"];
            string email = Request.QueryString["email"];
            string phone = Request.QueryString["phone"];
            string company = Request.QueryString["company"];
            string content = Request.QueryString["content"];

            var fbdto = new FeedbackDTO();
            fbdto.ID = Guid.NewGuid().ToString();
            fbdto.Fullname = name;
            fbdto.Email = email;
            fbdto.Phone = phone;
            fbdto.Company = company;
            fbdto.Content = content;
            fbdto.CreatedDate = DateTime.Now;

            try
            {
                var FbBus = new FeedbackBUS();
                FbBus.AddFeedback(fbdto);
                Response.Write("ok");
            }
            catch (Exception)
            {
                Response.Write("fail");
               
            }
           

        }
    }
}